package com.example.patient.jpa;

import com.example.common.entity.RxDrugs;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import java.util.List;

/**
 * @Author wxy
 * @Date 2021/1/22 10:34
 * @Version 1.0
 */
public interface RxDrugsRepository extends JpaRepository<RxDrugs, Long> {

    List<RxDrugs> findByRxOrderNo(String rxOrderNo);

    @Query(value = "select * from order_rx_drugs where rx_order_no_nvarchar in (:RxOrderNOs) and d_type_tinyint in (2,3)",nativeQuery = true)
    List<RxDrugs> findByType(@Param("RxOrderNOs") List<String> RxOrderNOs);
}
